 attribute vec3 aVertexPosition;
  attribute vec3 aTextureCoord;
  attribute vec3 aVertexNormal;

  uniform mat4 uMVMatrix;
  uniform mat4 uPMatrix;
  uniform mat3 uNMatrix;
  uniform vec3 camPosition;
  uniform float time;

  varying vec3 vTextureCoord;
  varying vec3 vTransformedNormal;
  varying vec4 vPosition;
  varying vec3 vViewVec;
  varying vec3 vNormal;


  void main(void) {
  		
        vPosition = uMVMatrix * vec4(aVertexPosition, 1.0);
   		vPosition.xz *= 0.15;
   		//vPosition.y = clamp( tan(aVertexPosition.z)*1.5 + tan(aVertexPosition.x)*1.5 , 0.0, 1.0)*cos(aVertexPosition.x+aVertexPosition.z)*5.0;
   		//vPosition.y *= sin(time*2.0);
   		
   		vPosition.y += (sin(time) * cos(vPosition.x*0.2) + cos(time) * sin(vPosition.z*0.2))*0.5;
   		//vPosition.y += (cos(time*4.0) * cos(vPosition.x*20.0)+ cos(time*2.0) * cos(vPosition.z*20.0))*0.125*sin((time*0.15));
   		vPosition.x -= (cos(time) * cos(vPosition.y));
   		vPosition.z += sin(time) * sin(vPosition.y);
   		
        gl_Position = uPMatrix * vPosition;
        vTextureCoord = vPosition.xyz;
        vTransformedNormal = uNMatrix * aVertexNormal;
		vViewVec = ( vPosition).xyz  - (camPosition.xyz);
        vNormal = ( uMVMatrix * vec4( aVertexNormal,1.0)).xyz;
     	
  }